home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 768 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  979 b 

  1. Path: castle.nando.net!news
  2. From: actuary@nando.net   (Bill McCarthy)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: A problem with fprintf
  5. Date: 9 Jan 1996 00:46:28 GMT
  6. Organization: News & Observer Public Access
  7. Message-ID: <4csdt4$mcn@castle.nando.net>
  8. References: <4cs8ie$5ru@no-names.nerdc.ufl.edu>
  9. Reply-To: actuary@nando.net (Bill McCarthy)
  10. NNTP-Posting-Host: grail1217.nando.net
  11. X-Newsreader: IBM NewsReader/2 v1.2
  12.  
  13. In <4cs8ie$5ru@no-names.nerdc.ufl.edu>,
  14. vtigadi@cis.ufl.edu (Vishwajit Tigadi) writes:
  15. >
  16. >I am experiencing a peculiar problem with fprintf.
  17. >I have a piece of code where the following statement fits in:
  18. >
  19. >fprintf(fp, "%s\n", src);
  20. >
  21. >fp is a file-pointer and src is a static array of characters. When the
  22. >code is executed repeatedly, it fails at the above statement. The error
  23. >message from the debugger is as follows:
  24.  
  25. %s expects a string, not merely an array of characters -- but a nul ('\0')
  26. terminated one.
  27.  
  28. Bill McCarthy
  29. actuary@nando.net
  30. Wendell, NC  USA
  31.  
  32.